package com.huiyujinrong.qiangdanbao.model;


import com.huiyujinrong.qiangdanbao.bean.BannerBean;
import com.huiyujinrong.qiangdanbao.bean.FragmentGrabSingleBean;
import com.huiyujinrong.qiangdanbao.bean.GrabsBean;
import com.huiyujinrong.qiangdanbao.network.AppService;

import javax.inject.Inject;

import happyloan.core.EventBusUtil;

public class GrabSingleModel {

    private AppService service;

    @Inject
    GrabSingleModel(AppService service) {
        this.service = service;
    }

    public void getGrabSingle(String city_code,
                              String loan_type,
                              int page_no,
                              int page_size,
                              String user_type,
                              String loan_use,
                              String apply_amt,
                              String loan_term,
                              String social_security_state,
                              String house_fund_state,
                              String industry_type,
                              String license_years,
                              String bank_dgls,
                              String bank_dsls) {
        EventBusUtil<FragmentGrabSingleBean> util = new EventBusUtil<>();
        util.sendEvent4Call(service.getGrabSingleData(city_code,
                loan_type,
                page_no,
                page_size,
                user_type,
                loan_use,
                apply_amt,
                loan_term,
                social_security_state,
                house_fund_state,
                industry_type,
                license_years,
                bank_dgls,
                bank_dsls));
    }

    public void getBannerHolder() {
        EventBusUtil<BannerBean> util = new EventBusUtil<>();
        util.sendEvent4Call(service.getBannerHolder());
    }

    public void findRealTimeGrab() {
        EventBusUtil<GrabsBean> util = new EventBusUtil<>();
        util.sendEvent4Call(service.findRealTimeGrab());
    }
}
